import java.util.Scanner;

/**
 * Created with Interllij IDEA.
 * Descriptiption:
 * User: 王澄慧
 * Date: 2022-04-03
 * Time: 23:08
 */
public class SecondDemo {
    public static void main(String[] args) {
        System.out.println("hahahahha"); // 输出一个字符串 换行
        System.out.print("hahahaha"); // 输出一个字符串 不换行
        int a = 10;
        System.out.printf("a = %d\n", a); // 格式化输出
        System.out.println('w');
    }
    public static void main10(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入你的名字：");
        String name = scanner.nextLine();
        System.out.println("请输入你的年龄：");
        int age = scanner.nextInt();
        System.out.println("请输入你的分数：");
        float scor = scanner.nextFloat();
    }
    public static void main9(String[] args) {
        int num = 0;
        do{
            System.out.println(num);
            num++;
        }while(num <= 10);
    }
    // 打印1~10之间的数
    public static void main8(String[] args) {
        int i = 0;
        for (i = 0; i <= 10 ; i++) {
            System.out.println(i);
        }
    }
    public static void main7(String[] args) {
        int i = 1;
        while(i <= 10){
            System.out.print(i);
            i++;
        }
    }
    public static void main6(String[] args) {
        //找出25~50之间的所有偶数
        int num = 25;
        while (num <= 50) {
            if(num %2 != 0 ){
                continue;
            }
            System.out.println("找到了所有偶数，为" + num);
            num++;
        }
    }
    public static void main5(String[] args) {
        //找出25~50之间的第一个偶数
        int num = 25;
        while(num <= 50){
            if(num % 2 == 0){
                System.out.println("找到第一个偶数了，为："  + num);
                break;
            }
            num ++;
        }
    }

    public static void main4(String[] args) {
        int day = 2;
        switch (day) {
            case 1: {
                System.out.println("哈哈哈");
                break;
            }
            case 2: {
                System.out.println("嘻嘻嘻");
                break;
            }
            default:{
                System.out.println("啦啦啦");
                break;
            }
        }
    }
    public static void main3(String[] args) {
        int i = 30;
        if(i < 20){
            System.out.println("哈哈哈！");
        }else if(i > 35){
            System.out.println("嘻嘻嘻！");
        }else{
            System.out.println("啦啦啦！");
        }
    }
    public static void main2(String[] args) {
        int t = 3;
        if(t <= 2){
            System.out.println("false");
        }else{
            System.out.println("true");
        }
    }
    public static void main1(String[] args) {
        System.out.println("abc");
        System.out.println("哈哈");
        System.out.println(123);
    }
}
